#!/bin/sh
PWD=$(cd `dirname $0`;pwd)
NODE=`which node`

userversion=$1

npm install miniprogram-ci

rm -f $PWD/ext.json
$NODE $PWD/node_modules/miniprogram-ci/bin/miniprogram-ci.js upload --appid wxcbb0dc1a2a07beab --pp . --uv $userversion --pkp $PWD/private.wxcbb0dc1a2a07beab.key -r 1 --enable-es6 true --enable-minify true

npm uninstall miniprogram-ci

git checkout $PWD/ext.json
git checkout $PWD/package-lock.json